package org.jeecg.modules.rental.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.model.EnumDictOption;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.rental.entity.RentalPackageLevel;
import org.jeecg.modules.rental.mapper.RentalPackageLevelMapper;
import org.jeecg.modules.rental.service.IRentalPackageLevelService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 租车套餐级别
 * @Author: jeecg-boot
 * @Date:   2024-06-05
 * @Version: V1.0
 */
@Service
public class RentalPackageLevelServiceImpl extends ServiceImpl<RentalPackageLevelMapper, RentalPackageLevel> implements IRentalPackageLevelService {


    @Override
    public IPage<RentalPackageLevel> selectJoinPage(Page page, RentalPackageLevel rentalPackageLevel) {
        Page<RentalPackageLevel> pageList = baseMapper.selectJoinPage(page, rentalPackageLevel);
        return pageList;
    }

    @Override
    public List<EnumDictOption> selectOptions() {
        LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
        return baseMapper.selectOptions(loginUser.getOrgCode()+"%");
    }
}
